<template>
	<view>
		<!-- 		<view class="head-cher">
			<image :src="baseurl+'/imgs2/hh3.png'" mode="widthFix"></image>
			<input type="text" placeholder="搜索美食/店面名称" placeholder-class="mo">
		</view>
		<view class="lc-laber">
			<view>味道好</view>
			<view>服务好</view>
			<view>性价比高</view>
			<view>装修精美</view>
		</view> -->
		<view class="comment">
			<view class="more-list" v-for="(item,index) in list">
				<view class="more-user">
					<image :src="item.user.avatar" mode="aspectFill" class="user-img">
					</image>
					<view class="user-detail">
						<view class="user-infor">
							<view>{{item.user.nickname}}</view>
						</view>
						<view class="time">{{item.createtime}}</view>
					</view>
				</view>
				<view class="dudu">
					<image
						:src="item.score >= 1 ?common.appUrl.oss+common.imgList.sc5:common.appUrl.oss+common.imgList.sc6"
						mode="widthFix"></image>
					<image
						:src="item.score >= 2 ?common.appUrl.oss+common.imgList.sc5:common.appUrl.oss+common.imgList.sc6"
						mode="widthFix"></image>
					<image
						:src="item.score >= 3 ?common.appUrl.oss+common.imgList.sc5:common.appUrl.oss+common.imgList.sc6"
						mode="widthFix"></image>
					<image
						:src="item.score >= 4 ?common.appUrl.oss+common.imgList.sc5:common.appUrl.oss+common.imgList.sc6"
						mode="widthFix"></image>
					<image
						:src="item.score >= 5 ?common.appUrl.oss+common.imgList.sc5:common.appUrl.oss+common.imgList.sc6"
						mode="widthFix"></image>
				</view>
				<view class="conswor">{{item.content}}</view>
				<view class="sp-imgs">
					<image :src="img" mode="aspectFill" v-for="(img,num) in images" @click="lookImage(index,num,img)">
					</image>
				</view>
				<view class="shop-hf" v-if="item.reply">
					<view class="s-title">商家回复：</view>
					<view class="s-words">{{item.reply}}</view>
				</view>
			</view>
		</view>
		<view class="lc-null"></view>
	</view>
</template>

<script>
	import {
		mapState,
	} from 'vuex';
	export default {
		data() {
			return {
				score: 5,
				baseurl: getApp().globalData.baseurl,
				id: '',
				app: getApp().globalData,
				page: 1,
				list: []
			}
		},
		computed: {
			...mapState(['user', 'statistics', 'common'])
		},
		onLoad(e) {
			this.id = e.id
			this.getData()
		},
		methods: {
			getData() {
				this.app.post('/api/chef/index/store_goods_info', {
					goods_id: this.id,
					page: this.page
				}).then(res => {
					console.log(res)
					this.list = this.list.concat(res.comment.data)
				})
			}
		},
		onReachBottom() {
			this.page += 1;
			this.getData();
		},
	}
</script>

<style lang="scss">
	.head-cher {
		width: 690rpx;
		margin-left: 30rpx;
		background-color: #EFF0F2;
		border-radius: 16rpx;
		display: flex;
		align-items: center;
		height: 70rpx;
		margin-top: 30rpx;

		image {
			width: 35rpx;
			height: 35rpx;
			margin-left: 23rpx;
		}

		input {
			width: 500rpx;
			font-size: 24rpx;
			margin-left: 15rpx;
		}
	}

	.lc-laber {
		width: 690rpx;
		margin-left: 30rpx;
		padding: 30rpx 0;
		display: flex;
		justify-content: space-between;

		view {
			font-size: 24rpx;
			color: #84BD00;
			background: rgba(132, 189, 0, 0.1);
			border-radius: 10rpx;
			width: 164rpx;
			height: 60rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}

	.comment {
		width: 750rpx;



		.c-head {
			width: 690rpx;
			display: flex;
			align-items: center;
			margin-left: 30rpx;
			padding-top: 30rpx;

			.c-h-name {
				font-size: 26rpx;
				margin-right: 80rpx;
				color: #333333;

				text {
					color: #999999;
					margin-left: 10rpx;
				}
			}

			.select-c-h-name {
				font-size: 26rpx;
				margin-right: 80rpx;
				color: #84BD00;

				text {
					color: #999999;
					margin-left: 10rpx;
				}
			}
		}

		.c-tab {
			width: 690rpx;
			display: flex;
			align-items: center;
			margin-left: 30rpx;
			padding: 30rpx 0;

			.c-t-name {
				background-color: #F6F6F6;
				padding: 8rpx 20rpx;
				font-size: 26rpx;
				margin-right: 20rpx;
				border-radius: 10rpx;
			}

			.select-c-t-name {
				background: rgba(140, 47, 82, 0.1);
				padding: 8rpx 20rpx;
				font-size: 26rpx;
				margin-right: 20rpx;
				border-radius: 10rpx;
				color: #84BD00;
			}
		}

		.more-list {
			width: 690rpx;
			margin-left: 30rpx;
			padding: 30rpx 0;
			background-color: #FFFFFF;
			margin-top: 30rpx;
			border-radius: 16rpx;

			.more-user {
				width: 630rpx;
				margin-left: 30rpx;
				display: flex;
				align-items: center;

				.user-img {
					width: 62rpx;
					height: 62rpx;
					border-radius: 50%;
				}

				.user-detail {
					width: 550rpx;
					margin-left: 18rpx;
					display: flex;
					justify-content: space-between;

					.user-infor {
						display: flex;
						align-items: center;

						view {
							font-size: 24rpx;
							color: #333333;
						}

						image {
							width: 73rpx;
							height: 30rpx;
							margin-left: 10rpx;
						}
					}

					.time {
						font-size: 22rpx;
						color: #999999;
					}
				}
			}

			.dudu {
				width: 630rpx;
				display: flex;
				align-items: center;
				margin-top: 20rpx;
				margin-left: 30rpx;

				view {
					font-size: 24rpx;
					color: #9E9E9E;
				}

				image {
					width: 20rpx;
					height: 20rpx;
					margin-right: 12rpx;
				}
			}

			.conswor {
				width: 630rpx;
				font-size: 30rpx;
				margin-left: 30rpx;
				color: #333333;
				margin-top: 20rpx;
			}

			.sp-imgs {
				width: 630rpx;
				margin-left: 30rpx;
				display: flex;
				flex-wrap: wrap;

				image {
					width: 180rpx;
					height: 180rpx;
					margin-top: 20rpx;
					margin-right: 20rpx;
					border-radius: 16rpx;
				}
			}

			.shop-hf {
				width: 630rpx;
				margin-left: 30rpx;
				padding: 30rpx;
				background-color: #F6F6F6;
				border-radius: 16rpx;
				margin-top: 20rpx;

				.s-title {
					font-size: 24rpx;
					color: #9E9E9E;
				}

				.s-words {
					font-size: 24rpx;
					color: #9E9E9E;
					margin-top: 20rpx;
				}
			}

			.tj-box {
				width: 690rpx;
				display: flex;
				align-items: center;
				margin-top: 20rpx;

				.tj-title {
					font-size: 24rpx;
					color: #333333;
				}

				.tj-shop {
					display: flex;
					align-items: center;
					background: rgba(140, 47, 82, 0.1);
					padding: 10rpx 20rpx;
					border-radius: 10rpx;

					view {
						font-size: 26rpx;
						color: #84BD00;
					}

					image {
						width: 20rpx;
						height: 20rpx;
						margin-top: 4rpx;
						margin-left: 4rpx;
					}
				}
			}
		}
	}
</style>